use ../processed/NLSY79.dta, clear

gen wage = exp(logwage)
gen female = sex==2
gen lE = exp(locE)
gen lE17 = exp(locE17)

estpost tabstat wage logwage hgc_cum hgc_r age AFQT3 nsibs dist2 dist4 tui2 tui4 locU locU17 locE locE17 lE lE17 [aw=wgt], stat(mean sd min p1 p10 q p99 max N) col(stat)
esttab using "../result/sumstat_c.txt", cells("mean sd min p1 p10 p25 p50 p75 p99 max count") replace

local vlist female blk hsp pub2 pub4 urban
forvalues j=0/5{
	gen hgc_m`j' = hgc_m==`j'
	gen hgc_f`j' = hgc_f==`j'
	local vlist `vlist' hgc_m`j' hgc_f`j'
}
estpost tabstat `vlist' [aw=wgt], stat(mean min max N) col(stat)
esttab using "../result/sumstat_d.txt", cells("mean min max count") replace

